<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>APP跳转测试</title>
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />

    <style>
        a{
            border: 1px solid paleturquoise;
            background-color: palevioletred;
            padding: 10px;
            margin-top: 10px;
            display: inline-block;
        }
    </style>

</head>

<body>
    <a href="http://apps.apple.com/cn/app/id387682726">苹果</a>
    <a href="https://itunes.apple.com/cn/app/id1532870903?mt=8">苹果</a>
    <a href="mimarket://details?id=com.tencent.mm">小米</a>
    <a href="appmarket://details?id=com.tencent.mm">华为</a>
    <a href="oppomarket://details?packagename=com.tencent.mm">OPPO</a>
    <a href="vivomarket://details?id=com.tencent.mm">VIVO</a>
    <a href="https://a.app.qq.com/o/simple.jsp?pkgname=com.tencent.mm">应用宝</a>

</body>

</html>

<script>

    var iosLinkUrl = "http://apps.apple.com/cn/app/id387682726" // 淘宝 app store 下载地址
    var androidLinkurl = "mimarket://details?id=com.tencent.mm" //(找不到淘宝应用宝地址，这里以lucky coffee为例)

    var u = navigator.userAgent, isAndroid, isIOS


    function init() {
        isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端
        isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端

        var link = isIOS ? iosLinkUrl : androidLinkurl

        window.location.href = link;
    }

</script>